module DataTypes
	INT = "int"
	FLOAT = "float"
	STRING = "string"
end

class DataFormat

	attr_reader :datatype
	attr_accessor :value

	def initialize(datatype, value)
		@datatype = datatype
		@value = value
	end

end

class Value < DataFormat

	attr_accessor :min, :max, :default
	
	def initialize(datatype, default, min=0, max=nil)
		super(datatype, default)
		@min = min
		@max = max
	end

end

class List < DataFormat

	attr_accessor :elements, :selected

	def initialize(datatype, default, listElements)
		super(datatype, listElements[default].value)
		@elements = listElements
		@selected = default
		@selected = 0 if @selected > @elements.size
	end

end

class ListElement
	
	attr_accessor :text, :value

	def initialize(text, value)
		@text = text
		@value = value
	end
	
end
